//确定缩放具体是个点位
import { onMounted, onUnmounted, ref } from "vue"
const diagonas = ['top-right','top-left','bottom-left','bottom-right'];
const UseDiagonalHandle = () => {
  const doms = document.getElementsByClassName('es-drager-dot');
  const isDiagonalHandle = ref(false)
  onMounted(() => {
    for (let i = 0; i < doms.length; i++) {
      doms[i].addEventListener('mousedown', (evt) => {
        isDiagonalHandle.value = diagonas.some(item => {
          return doms[i].dataset.side.includes(item)
        })
      })
    }
  })
  onUnmounted(() => {
    for (let i = 0; i < doms.length; i++) {
      doms[i].removeEventListener('mousedown', (evt) => {
        
      })
    }
  })
  return isDiagonalHandle
}
export default UseDiagonalHandle